<template>
  <div>
    <el-form ref="postRef" :model="form" label-width="auto" :label-position="labelPosition">
      <el-row :gutter="gutter">
        <!-- 氮气 -->
        <template v-if="currentRedgerType == '2'">
          <el-col :span="span">
            <el-form-item label="工作时间" prop="workingHours">
              <el-input v-model="form.workingHours" placeholder="请输入工作时间" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="总气量" prop="totalGasVolume">
              <el-input v-model="form.totalGasVolume" placeholder="请输入总气量" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="基价" prop="basePrice">
              <el-input v-model="form.basePrice" placeholder="请输入基价" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="超标价(元)" prop="overBidPrice">
              <el-input v-model="form.overBidPrice" placeholder="请输入超标价(元)" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount" placeholder="请输入预计金额" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>
        </template>
        <!-- 固井 -->
        <template v-else-if="currentRedgerType == '3'">
          <el-col :span="span">
            <el-form-item label="灰浆总量" prop="totalAmountOfMortar">
              <el-input v-model="form.totalAmountOfMortar" placeholder="请输入灰浆总量" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="干灰量">
              <el-input v-model="form.dryAshContent" placeholder="请输入干灰量" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="水泥单价" prop="unitPriceOfCement">
              <el-input v-model="form.unitPriceOfCement" placeholder="请输入水泥单价" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="水泥小计" prop="subtotalOfCement">
              <el-input v-model="form.subtotalOfCement"
                :placeholder="form.subtotalOfCement = form.dryAshContent * form.unitPriceOfCement" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="服务费" prop="serviceCharge">
              <el-input v-model="form.serviceCharge" placeholder="请输入服务费" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount"
                :placeholder="form.estimatedAmount = form.dryAshContent * form.unitPriceOfCement + form.serviceCharge * 1" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>
        </template>
        <!-- 连续油管 -->
        <template v-else-if="currentRedgerType == '4'">
          <el-col :span="span">
            <el-form-item label="累计时间" prop="accumulatedTime">
              <el-input v-model="form.accumulatedTime" placeholder="请输入累计时间" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount" placeholder="请输入预计金额" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>
        </template>
        <!-- 留井材料 -->
        <template v-else-if="currentRedgerType == '5'">
          <el-col :span="span">
            <el-form-item label="出库金额" prop="outboundAmount">
              <el-input v-model="form.outboundAmount" placeholder="请输入出库金额" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount"
                :placeholder="form.estimatedAmount = (form.outboundAmount * 1.08).toFixed(2)" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>
        </template>
        <!-- 外部油管摊销 -->
        <template v-else-if="currentRedgerType == '7'">
          <el-col :span="span">
            <el-form-item label="油管类型" prop="oilPipeType">
              <el-select v-model="form.oilPipeType" placeholder="请选择油管类型" class="el-width" filterable clearable>
                <el-option v-for="dict in oilpipe_type" :key="dict.value" :label="dict.label"
                  :value="dict.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="数量" prop="oilPipeNum">
              <el-input v-model="form.oilPipeNum" placeholder="请输入数量" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="深度" prop="depth">
              <el-input v-model="form.depth" placeholder="请输入深度" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="单价" prop="unitprice">
              <el-input v-model="form.unitprice" placeholder="请输入单价" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="比例" prop="oilpipeRatio">
              <el-select v-model="form.oilpipeRatio" placeholder="请选择比例" class="el-width" filterable clearable>
                <el-option v-for="dict in oilpipe_ratio" :key="dict.value" :label="dict.label"
                  :value="dict.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount"
                :placeholder="form.estimatedAmount = (form.depth * form.unitprice * form.oilpipeRatio).toFixed(2)"
                disabled />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>
        </template>
        <!-- 油管 -->
        <template v-else-if="currentRedgerType == '8'">
          <el-col :span="span">
            <el-form-item label="油管类型" prop="oilPipeType">
              <el-select v-model="form.oilPipeType" placeholder="请选择油管类型" class="el-width" filterable clearable>
                <el-option v-for="dict in oilpipe_type" :key="dict.value" :label="dict.label"
                  :value="dict.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="油管型号" prop="oilPipeModel">
              <el-select v-model="form.oilPipeModel" placeholder="请选择油管型号" class="el-width" filterable clearable>
                <el-option v-for="dict in oilpipe_model" :key="dict.value" :label="dict.label"
                  :value="dict.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="数量" prop="oilPipeNum">
              <el-input v-model="form.oilPipeNum" placeholder="请输入数量" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="单位" prop="oilPipeUnit">
              <el-select v-model="form.oilPipeUnit" placeholder="请选择单位" class="el-width" filterable clearable>
                <el-option v-for="dict in oilpipe_unit" :key="dict.value" :label="dict.label"
                  :value="dict.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="单价" prop="oilPipePrice">
              <el-input v-model="form.oilPipePrice" placeholder="请输入单价" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount"
                :placeholder="form.estimatedAmount = form.oilPipeNum * form.oilPipePrice" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>
        </template>
        <!-- 抽油杆 -->
        <template v-else-if="currentRedgerType == '9'">
          <el-col :span="span">
            <el-form-item label="抽油杆型号" prop="suckerRodModel">
              <el-select v-model="form.suckerRodModel" placeholder="请选择抽油杆型号" class="el-width" filterable clearable>
                <el-option v-for="dict in suckerrod_model" :key="dict.value" :label="dict.label"
                  :value="dict.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="数量" prop="oilPipeNum">
              <el-input v-model="form.oilPipeNum" placeholder="请输入数量" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="单位" prop="oilPipeUnit">
              <el-select v-model="form.oilPipeUnit" placeholder="请选择单位" class="el-width" filterable clearable>
                <el-option v-for="dict in oilpipe_unit" :key="dict.value" :label="dict.label"
                  :value="dict.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="单价" prop="oilPipePrice">
              <el-input v-model="form.oilPipePrice" placeholder="请输入单价" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount"
                :placeholder="form.estimatedAmount = form.oilPipeNum * form.oilPipePrice" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>

        </template>
        <!-- 废液和固废 -->
        <template v-else-if="currentRedgerType == '10' || currentRedgerType == '11'">
          <el-col :span="span">
            <el-form-item label="接收数量" prop="receivedQuantity">
              <el-input v-model="form.receivedQuantity" placeholder="请输入接收数量" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="单位" prop="oilPipeUnit">
              <el-input v-model="form.oilPipeUnit" placeholder="方" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="单价" prop="oilPipePrice">
              <el-input v-model="form.oilPipePrice" placeholder="请输入单价" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount"
                :placeholder="form.estimatedAmount = form.receivedQuantity * form.oilPipePrice" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>
        </template>
        <!-- 上传收入台账 -->
        <template v-else-if="currentRedgerType == '14'">

        </template>
        <!-- 管理费台账 -->
        <template v-else-if="currentRedgerType == '15'">
          <el-col :span="span">
            <el-form-item label="管理费预计金额" prop="estimatedAmountOfManagementFees">
              <el-input v-model="form.estimatedAmountOfManagementFees" placeholder="请输入管理费预计金额" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="付款时间" prop="paymentTime">
              <el-date-picker v-model="form.paymentTime" type="date" placeholder="请选择付款时间" class="el-width" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualAmountOfManagementFees">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入管理费实结金额" />
            </el-form-item>
          </el-col>
        </template>
        <!-- 侧钻收入台账 -->
        <template v-else-if="currentRedgerType == '16'">
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount" placeholder="请输入预计金额" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="工序费" prop="processCost">
              <el-input v-model="form.processCost" placeholder="请输入工序费" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="扣款" prop="deduction">
              <el-input v-model="form.deduction" placeholder="请输入扣款" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="造价审定金额" prop="costApprovalAmount">
              <el-input v-model="form.costApprovalAmount" placeholder="请输入造价审定金额" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="对外结算" prop="externalSettlement">
              <el-select v-model="form.externalSettlement" placeholder="是否对外结算" class="el-width" clearable>
                <el-option v-for="dict in yn" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </template>
        <!-- 检泵6 井控17 外部劳务收入台账12  其他服务13 -->
        <template v-else>
          <el-col :span="span">
            <el-form-item label="预计金额" prop="estimatedAmount">
              <el-input v-model="form.estimatedAmount" placeholder="请输入预计金额" />
            </el-form-item>
          </el-col>
          <el-col :span="span">
            <el-form-item label="实结金额" prop="actualSettlementAmount">
              <el-input v-model="form.actualSettlementAmount" placeholder="请输入实结金额" />
            </el-form-item>
          </el-col>
        </template>
      </el-row>
    </el-form>
  </div>
</template>

<script setup lang="js">
import { ref } from 'vue';
// 字典引入
const { proxy } = getCurrentInstance();
const { oilpipe_type, oilpipe_model, suckerrod_model, oilpipe_unit, oilpipe_ratio, yn } = proxy.useDict(
  "oilpipe_type", "oilpipe_model", "suckerrod_model", "oilpipe_unit", "oilpipe_ratio", 'yn');


const gutter = ref(24)
const width =ref('120px')

const props = defineProps(['redgerType','span','labelPosition'])
const currentRedgerType = props.redgerType
const span =props.span
const labelPosition = props.labelPosition

const form = ref({})

defineExpose({ form })
</script>
<style scoped></style>